package com.ruoyi.records.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.records.mapper.BorrowRecordsMapper;
import com.ruoyi.records.domain.BorrowRecords;
import com.ruoyi.records.service.IBorrowRecordsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 图书借阅管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-07
 */
@Service
public class BorrowRecordsServiceImpl implements IBorrowRecordsService 
{
    @Autowired
    private BorrowRecordsMapper borrowRecordsMapper;

    /**
     * 查询图书借阅管理
     * 
     * @param recordId 图书借阅管理主键
     * @return 图书借阅管理
     */
    @Override
    public BorrowRecords selectBorrowRecordsByRecordId(Long recordId)
    {
        return borrowRecordsMapper.selectBorrowRecordsByRecordId(recordId);
    }

    /**
     * 查询图书借阅管理列表
     * 
     * @param borrowRecords 图书借阅管理
     * @return 图书借阅管理
     */
    @Override
    public List<BorrowRecords> selectBorrowRecordsList(BorrowRecords borrowRecords)
    {
        return borrowRecordsMapper.selectBorrowRecordsList(borrowRecords);
    }

    /**
     * 新增图书借阅管理
     * 
     * @param borrowRecords 图书借阅管理
     * @return 结果
     */
    @Override
    public int insertBorrowRecords(BorrowRecords borrowRecords)
    {
        return borrowRecordsMapper.insertBorrowRecords(borrowRecords);
    }

    /**
     * 修改图书借阅管理
     * 
     * @param borrowRecords 图书借阅管理
     * @return 结果
     */
    @Override
    public int updateBorrowRecords(BorrowRecords borrowRecords)
    {
        return borrowRecordsMapper.updateBorrowRecords(borrowRecords);
    }

    /**
     * 批量删除图书借阅管理
     * 
     * @param recordIds 需要删除的图书借阅管理主键
     * @return 结果
     */
    @Override
    public int deleteBorrowRecordsByRecordIds(String recordIds)
    {
        return borrowRecordsMapper.deleteBorrowRecordsByRecordIds(Convert.toStrArray(recordIds));
    }

    /**
     * 删除图书借阅管理信息
     * 
     * @param recordId 图书借阅管理主键
     * @return 结果
     */
    @Override
    public int deleteBorrowRecordsByRecordId(Long recordId)
    {
        return borrowRecordsMapper.deleteBorrowRecordsByRecordId(recordId);
    }
}
